﻿using System;

namespace NiuX;

public static class DateTimeExtensions
{
    public static string GetDayName(this DateTime dateTime)
    {
        return System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(dateTime.DayOfWeek);
    }

    public static bool IsWeek1(this DateTime dateTime) => dateTime.GetDayName() == "星期一";
    public static bool IsWeek2(this DateTime dateTime) => dateTime.GetDayName() == "星期二";
    public static bool IsWeek3(this DateTime dateTime) => dateTime.GetDayName() == "星期三";
    public static bool IsWeek4(this DateTime dateTime) => dateTime.GetDayName() == "星期四";
    public static bool IsWeek5(this DateTime dateTime) => dateTime.GetDayName() == "星期五";
    public static bool IsWeek6(this DateTime dateTime) => dateTime.GetDayName() == "星期六";
    public static bool IsWeek7(this DateTime dateTime) => dateTime.GetDayName() == "星期七";
}